package observer;


/**
 * 第三方
 */
public class CurrentConditions {
    // 温度
    private float temperature;
    // 气压
    private float pressure;
    // 湿度
    private float humidity;

    //更新 天气情况，是由 WeatherData 来调用，我使用推送模式
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    //显示
    public void display() {
        System.out.println("***气温: " + temperature + "***");
        System.out.println("***气压: " + pressure + "***");
        System.out.println("***湿度: " + humidity + "***");
    }
}
